﻿using System;
using System.Linq;

namespace Behaviorize.TextFormatting
{
	public static class PascalFormatter
	{
		private static string CapitalizeWord(string word)
		{
			return char.ToUpper(word.First()) + word.Substring(1);
		}

		public static string ToPascalCase(string text)
		{
			string[] words = text.Split(' ');
			return String.Join("", words.Select(CapitalizeWord).ToArray());
		}
	}
}